<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!-- import CSS -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
    <style>
        .el-header, .el-footer {
            background-color: #B3C0D1;
            color: #333;
            text-align: center;
            line-height: 60px;
        }

        .el-aside {
            background-color: #D3DCE6;
            color: #333;
            text-align: center;
            line-height: 200px;
        }

        .el-main {
            background-color: #E9EEF3;
            color: #333;
            text-align: center;
            line-height: 160px;
        }

        body > .el-container {
            margin-bottom: 40px;
        }

        .el-container:nth-child(5) .el-aside,
        .el-container:nth-child(6) .el-aside {
            line-height: 260px;
        }

        .el-container:nth-child(7) .el-aside {
            line-height: 320px;
        }
    </style>
</head>
<body>
<div id="app">
    <el-container>
        <el-header>达内后台管理系统</el-header>
        <el-container>
            <el-aside width="200px">
                <el-menu
                        default-active="2"
                        class="el-menu-vertical-demo"
                        @open="handleOpen"
                        @close="handleClose"
                        background-color="#545c64"
                        text-color="#fff"
                        active-text-color="#ffd04b">
                    <el-submenu index="1">
                        <template slot="title">
                            <i class="el-icon-location"></i>
                            <span>员工管理</span>
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="1-1">员工列表</el-menu-item>
                            <el-menu-item index="1-2">添加员工</el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                    </el-submenu>
                    <el-submenu index="2">
                        <template slot="title">
                            <i class="el-icon-location"></i>
                            <span>部门管理</span>
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="2-1">部门列表</el-menu-item>
                            <el-menu-item index="2-2">添加部门</el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                </el-menu>
            </el-aside>
            <el-main>
                <h1>员工列表</h1>
                <el-form label-width="60px">
                    <el-form-item label="员工名">
                        <el-input type="name" placeholder="请输入员工名" v-model="emp.name"></el-input>
                    </el-form-item>
                    <el-form-item label="职位">
                        <el-input type="job" placeholder="请输入员工职位" v-model="emp.job"></el-input>
                    </el-form-item>
                </el-form>
                <table border="1">
                    <tr>
                        <th width="100px">序号</th>
                        <th width="400px">员工姓名</th>
                        <th width="400px">员工职位</th>
                    </tr>
                    <tr v-for="(e,i) in emps">
                        <td>{{i+1}}</td>
                        <td>{{e.name}}</td>
                        <td>{{e.job}}</td>
                    </tr>
                </table>
            </el-main>
        </el-container>
    </el-container>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
    let v = new Vue({
        el: '#app',
        data: function () {
            return {
                emp: {name: "", job: ""},
                emps: [{name: "张三", job: "保安"},
                    {name: "李四", job: "保洁"}]
            }
        },
        methods: {
            handleOpen(key, keyPath) {
                console.log(key, keyPath);
            },
            handleClose(key, keyPath) {
                console.log(key, keyPath);
            }
        }
    })
</script>
</html>